﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Framework.Extensions
{
    public static class StringEnumerableExtensions
    {
        public static string SeparateBy(this IEnumerable<string> src, string separator)
        {
            var e = src.GetEnumerator();
            if (!e.MoveNext()) return String.Empty;
            var sb = new StringBuilder(e.Current);
            while (e.MoveNext())
            {
                sb.Append(separator);
                sb.Append(e.Current);
            }
            return sb.ToString();
        }
    }
}